﻿@model IEnumerable<Etest.Models.Test>

<script type="text/javascript">
    $().ready(function () {
        $("#courseId").live("change",function () {

            var course = parseInt($(this).val());

            $.ajax({
                url: '@Url.Action("TestsPartial")',
                data: { "course": course },
                success: function (data) {
                    $("#tests-partial").html(data); //data e partial view
                }
            });
        });
    });
</script>

@{
    ViewBag.Title = "Index";
}

<div class="container">
	<div class="row">
	<div class="col-md-4">
    <div class="jumbotron" style="font-size: 15px;">
        <ul class="nav nav-pills nav-stacked">
            <li class="active">  @Html.ActionLink("Денешни тестови", "Index","Test")</li>
        <//ul>

    </div>
	</div>
	<div class="col-md-8">
	<div class="jumbotron" style="font-size: 10px;">

@Html.DropDownList("courseId", String.Empty)

<div id="tests-partial">
    <!-- nema potreba od ova oti ne ni treba da prikaze kurs na pocetok -->
    @if (Model!=null)
    {
        @Html.Partial("TestsPartial") <!-- ako ne mu zadades model tuka go zema istiov od ovaa Index strana -->
                                      <!-- moze i model da mu dades so zapirka -->
    }
</div>

     </div>
    </div>
    </div>	
	</div>